//
//  RecommendDatailTableCell.m
//  CommonFrame
//
//  Created by Bang-guo on 15/7/20.
//  Copyright (c) 2015年 guobang. All rights reserved.
//

#import "RecommendDatailTableCell.h"
#import <UIImageView+WebCache.h>

@implementation RecommendDatailTableCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createSubViews];
        
    }
    
    return self;
}

-(void)createSubViews {
    
    self.dayL = [[BaseLabel alloc] initWithFrame:CGRectMake(15, 0, WIDTH, 30)];
//    self.dayL.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.dayL];
//    self.dayL.textAlignment = NSTextAlignmentCenter;
    self.dayL.font = [UIFont systemFontOfSize:20];
    
    self.photo_sImage = [[UIImageView alloc] initWithFrame:CGRectMake(15, self.dayL.frame.origin.y + self.dayL.frame.size.height, WIDTH - 30, WIDTH - 50)];
//    self.photo_sImage.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.photo_sImage];
    
    self.local_timeL = [[BaseLabel alloc] initWithFrame:CGRectMake(0, self.photo_sImage.frame.origin.y + self.photo_sImage.frame.size.height, WIDTH, 20)];
//    self.local_timeL.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:self.local_timeL];
    self.local_timeL.textAlignment = NSTextAlignmentCenter;
    
    
    
    
}

-(void)setRecDetail:(RecommendDetail *)recDetail {
    
    if (_recDetail != recDetail) {
        
        _recDetail = recDetail;
    }
//    self.dayL.text = recDetail.day;
    [self.photo_sImage sd_setImageWithURL:[NSURL URLWithString:recDetail.photo_s] placeholderImage:[UIImage imageNamed:@"icon1024.png"]];
    self.local_timeL.text = recDetail.local_time;
  
    
}

-(void)setRecDetail1:(RecommendDetail *)recDetail1 {
    
    if (_recDetail1 != recDetail1) {
        
        _recDetail1 = recDetail1;
    }
    NSString *str = [NSString stringWithFormat:@"第%@天 %@", recDetail1.day, recDetail1.date];
    self.dayL.text = str;
    

}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
